//
//  main.m
//  内存作业
//
//  Created by dllo on 15/12/10.
//  Copyright © 2015年 dllo. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "OurClass.h"
#import "Teacher.h"
#import "Student.h"

int main(int argc, const char * argv[]) {
    @autoreleasepool {
          Teacher *teacher = [[Teacher alloc] init];
        OurClass *ourclass = [[OurClass alloc]init];
        teacher.ourclass = ourclass;
        ourclass.teacher = teacher;
        
        for (int i = 0; i < 10; i++) {
            Student *stu = [[Student alloc]init];
            stu.name = [NSString stringWithFormat:@"stu:%d",i];
            stu.age = arc4random() % (71 - 2 + 1) + 2;
            stu.number = i;
            [ourclass addStudent:stu];
        }
        
        [teacher exam:@"English"];
        [ourclass listAllStudent];
        
        
        
        
        
        
        
        
    }
    return 0;
}
